  <div class="padding-all">
	  <div ng-include src="'/ksr/partials/breadcrumb.htm'"></div>
	
	<div class="panel panel-default">
	  <div class="panel-heading">
	    <h3 class="panel-title capitalize">
	    	<span  ng-if="mode=='edit'">Edit</span>
	    	<span  ng-if="mode=='new'">Create</span>
	    	 Schedule for event <span class="font-orange">{{schedule.event.eventName}}</span>
    	</h3>
	  </div>
	  <div class="panel-body">
		<form role="form" name = "scheduleForm" class="ksr-form" ng-submit="scheduleForm.$valid&&submit()" novalidate>
			
			<div class="error alert alert-danger pull-left" ng-show="submitted&&scheduleForm.scheduleType.$error.required">
		    	<span class="glyphicon glyphicon-warning-sign"></span> Schedule type is required
	    	</div>
	    	<div class="clearfix"></div>
		  	<div class="input-group input-group-lg margin-bottom">
			  <span class="input-group-addon">Sched. Type</span>
			  <input type="text" class="form-control" name="scheduleType" ng-model="schedule.scheduleType" ng-required="true" placeholder="Enter schedule type"/>
			</div>
			<div class="clearfix"></div>

			<div class="error alert alert-danger pull-left" ng-show="submitted&&scheduleForm.startDate.$error.required">
		    	<span class="glyphicon glyphicon-warning-sign"></span> Start Date is required
	    	</div>
	    	<div class="clearfix"></div>
		  	<div class="input-group input-group-lg margin-bottom">
			  <span class="input-group-addon">Start Date</span>
			  <input type="date" class="form-control" name="startDate" ng-model="schedule.startDate" placeholder="Enter start date" ng-required="true"/>
			</div>
			<div class="clearfix"></div>

			<div class="error alert alert-danger pull-left" ng-show="submitted&&scheduleForm.endDate.$error.required">
		    	<span class="glyphicon glyphicon-warning-sign"></span> End Date is required
	    	</div>
	    	<div class="clearfix"></div>
		  	<div class="input-group input-group-lg margin-bottom">
			  <span class="input-group-addon">End Date</span>
			  <input type="date" class="form-control" name="endDate" ng-model="schedule.endDate" placeholder="Enter end date" ng-required="true"/>
			</div>
			<div class="clearfix"></div>

			<div class="error alert alert-danger pull-left" ng-show="submitted&&scheduleForm.openingTime.$error.required">
		    	<span class="glyphicon glyphicon-warning-sign"></span> Open Time is required
	    	</div>
	    	<div class="clearfix"></div>
		  	<div class="input-group input-group-lg margin-bottom">
			  <span class="input-group-addon">Open Time</span>
			  <input type="time" class="form-control" name="openingTime" ng-model="schedule.openingTime" placeholder="HH:mm:ss" required />
			</div>
			<div class="clearfix"></div>


			<div class="error alert alert-danger pull-left" ng-show="submitted&&scheduleForm.closingTime.$error.required">
		    	<span class="glyphicon glyphicon-warning-sign"></span> Close Time is required
	    	</div>
	    	<div class="clearfix"></div>
		  	<div class="input-group input-group-lg margin-bottom">
			  <span class="input-group-addon">Close Time</span>
			  <input type="time" class="form-control" name="closingTime" ng-model="schedule.closingTime" placeholder="HH:mm:ss" required=true />
			</div>
			<div class="clearfix"></div>
<!--
			<div ng-repeat="add in schedule.eventAddresses">
				<div class="error alert alert-danger pull-left" ng-show="submitted&&scheduleForm.addressLine1$index.$error.required">
			    	<span class="glyphicon glyphicon-warning-sign"></span> Address Line1 is required
		    	</div>
		    	<div class="clearfix"></div>
			  	<div class="input-group input-group-lg margin-bottom">
				  <span class="input-group-addon">Address L1</span>
				  <input type="text" class="form-control" name="addressLine1$index" ng-model="add.addressLine1" placeholder="Enter address line1" ng-required="true"/>
				</div>
				<div class="clearfix"></div>

			  	<div class="input-group input-group-lg margin-bottom">
				  <span class="input-group-addon">Address L2</span>
				  <input type="text" class="form-control" name="startDate" ng-model="add.addressLine2" placeholder="Enter address line2"/>
				</div>
				<div class="clearfix"></div>				
	
				<div class="error alert alert-danger pull-left" ng-show="submitted&&scheduleForm.city$index.$error.required">
			    	<span class="glyphicon glyphicon-warning-sign"></span> City is required
		    	</div>
		    	<div class="clearfix"></div>
			  	<div class="input-group input-group-lg margin-bottom">
				  <span class="input-group-addon">City</span>
				  <input type="text" class="form-control" name="city$index" ng-model="add.city" placeholder="Enter city" ng-required="true"/>
				</div>
				<div class="clearfix"></div>				
	
				<div class="error alert alert-danger pull-left" ng-show="submitted&&scheduleForm.state$index.$error.required">
			    	<span class="glyphicon glyphicon-warning-sign"></span> State is required
		    	</div>
		    	<div class="clearfix"></div>
			  	<div class="input-group input-group-lg margin-bottom">
				  <span class="input-group-addon">State</span>
				  <input type="text" class="form-control" name="state$index" ng-model="add.state" placeholder="Enter state" ng-required="true"/>
				</div>
				<div class="clearfix"></div>			
	
				<div class="error alert alert-danger pull-left" ng-show="submitted&&scheduleForm.zip$index.$error.required">
			    	<span class="glyphicon glyphicon-warning-sign"></span> zip is required
		    	</div>
		    	<div class="clearfix"></div>
			  	<div class="input-group input-group-lg margin-bottom">
				  <span class="input-group-addon">zip</span>
				  <input type="text" class="form-control" name="zip$index" ng-model="add.zip" placeholder="Enter zip" ng-required="true"/>
				</div>
				<div class="clearfix"></div>
			</div>
-->
			<button class="btn btn-success" ng-click="addAddress()">
				<span class="glyphicon glyphicon-plus-sign"></span>
				Add an address
			</button>
			<dir class="clearfix no-margin-bottom"></dir>
			<tabset class="margin-bottom" ng-if="schedule.eventAddresses.length>0">
			    <tab ng-repeat="add in schedule.eventAddresses">
			    <tab-heading active="add.active" class="fade in active">
			    	Add. {{$index+1}}
					<a ng-click="schedule.eventAddresses.splice($index,1)" href=''><span class="glyphicon glyphicon-remove"></span></a>
			    </tab-heading>
				<div class="error alert alert-danger pull-left" ng-show="submitted&&scheduleForm.addressLine1.$error.required">
			    	<span class="glyphicon glyphicon-warning-sign"></span> Address Line1 is required
		    	</div>
		    	<div class="clearfix"></div>
			  	<div class="input-group input-group-lg margin-bottom">
				  <span class="input-group-addon">Address L1</span>
				  <input type="text" class="form-control" name="addressLine1" ng-model="add.addressLine1" placeholder="Enter address line1" ng-required="true"/>
				</div>
				<div class="clearfix"></div>

			  	<div class="input-group input-group-lg margin-bottom">
				  <span class="input-group-addon">Address L2</span>
				  <input type="text" class="form-control" name="startDate" ng-model="add.addressLine2" placeholder="Enter address line2"/>
				</div>
				<div class="clearfix"></div>				
	
				<div class="error alert alert-danger pull-left" ng-show="submitted&&scheduleForm.city.$error.required">
			    	<span class="glyphicon glyphicon-warning-sign"></span> City is required
		    	</div>
		    	<div class="clearfix"></div>
			  	<div class="input-group input-group-lg margin-bottom">
				  <span class="input-group-addon">City</span>
				  <input type="text" class="form-control" name="city" ng-model="add.city" placeholder="Enter city" ng-required="true"/>
				</div>
				<div class="clearfix"></div>				
	
				<div class="error alert alert-danger pull-left" ng-show="submitted&&scheduleForm.state[$index].$error.required">
			    	<span class="glyphicon glyphicon-warning-sign"></span> State is required
		    	</div>
		    	<div class="clearfix"></div>
			  	<div class="input-group input-group-lg margin-bottom">
				  <span class="input-group-addon">State</span>
				  <input type="text" class="form-control" name="state" ng-model="add.state" placeholder="Enter state" ng-required="true"/>
				</div>
				<div class="clearfix"></div>			
	
				<div class="error alert alert-danger pull-left" ng-show="submitted&&scheduleForm.zip.$error.required">
			    	<span class="glyphicon glyphicon-warning-sign"></span> zip is required
		    	</div>
		    	<div class="clearfix"></div>
			  	<div class="input-group input-group-lg margin-bottom">
				  <span class="input-group-addon">zip</span>
				  <input type="text" class="form-control" name="zip" ng-model="add.zip" placeholder="Enter zip" ng-required="true"/>
				</div>
				<div class="clearfix"></div>
			    </tab>
			  </tabset>

	


			
		  
		  <button type="submit" ng-click="submitted=true" class="btn btn-primary">Submit</button>
		  <a  ng-href="#/overview" class="btn btn-default">Cancel</a>
		</form>
	  </div>
	</div>
	
	<!-- 
	 -->
	<pre ng-bind="schedule | json"></pre>
 </div>